3.70 \(\int \frac{(d+e x^n)^2}{a+b x^n+c x^{2 n}} \, dx\)

Optimal. Leaf size=224 \[ \frac{x \left (\frac{-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2}{\sqrt{b^2-4 a c}}-b e^2+2 c d e\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{c \left (b-\sqrt{b^2-4 a c}\right )}+\frac{x \left (-\frac{-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2}{\sqrt{b^2-4 a c}}-b e^2+2 c d e\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{c \left (\sqrt{b^2-4 a c}+b\right )}+\frac{e^2 x}{c} \]

[Out]

(e^2*x)/c + ((2*c*d*e - b*e^2 + (2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))/Sqrt[b^2 - 4*a*c])*x*Hypergeometric2
F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(c*(b - Sqrt[b^2 - 4*a*c])) + ((2*c*d*e - b*e^2
 - (2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))/Sqrt[b^2 - 4*a*c])*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2
*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(c*(b + Sqrt[b^2 - 4*a*c]))

________________________________________________________________________________________

Rubi [A]  time = 0.475921, antiderivative size = 224, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {1424, 1422, 245} \[ \frac{x \left (\frac{-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2}{\sqrt{b^2-4 a c}}-b e^2+2 c d e\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{c \left (b-\sqrt{b^2-4 a c}\right )}+\frac{x \left (-\frac{-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2}{\sqrt{b^2-4 a c}}-b e^2+2 c d e\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{c \left (\sqrt{b^2-4 a c}+b\right )}+\frac{e^2 x}{c} \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x^n)^2/(a + b*x^n + c*x^(2*n)),x]

[Out]

(e^2*x)/c + ((2*c*d*e - b*e^2 + (2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))/Sqrt[b^2 - 4*a*c])*x*Hypergeometric2
F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(c*(b - Sqrt[b^2 - 4*a*c])) + ((2*c*d*e - b*e^2
 - (2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))/Sqrt[b^2 - 4*a*c])*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2
*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(c*(b + Sqrt[b^2 - 4*a*c]))

Rule 1424

Int[((d_) + (e_.)*(x_)^(n_))^(q_)/((a_) + (b_.)*(x_)^(n_) + (c_.)*(x_)^(n2_)), x_Symbol] :> Int[ExpandIntegran
d[(d + e*x^n)^q/(a + b*x^n + c*x^(2*n)), x], x] /; FreeQ[{a, b, c, d, e, n}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4
*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[q]

Rule 1422

Int[((d_) + (e_.)*(x_)^(n_))/((a_) + (b_.)*(x_)^(n_) + (c_.)*(x_)^(n2_)), x_Symbol] :> With[{q = Rt[b^2 - 4*a*
c, 2]}, Dist[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^n), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), In
t[1/(b/2 + q/2 + c*x^n), x], x]] /; FreeQ[{a, b, c, d, e, n}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] && NeQ
[c*d^2 - b*d*e + a*e^2, 0] && (PosQ[b^2 - 4*a*c] ||  !IGtQ[n/2, 0])

Rule 245

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*x*Hypergeometric2F1[-p, 1/n, 1/n + 1, -((b*x^n)/a)],
x] /; FreeQ[{a, b, n, p}, x] &&  !IGtQ[p, 0] &&  !IntegerQ[1/n] &&  !ILtQ[Simplify[1/n + p], 0] && (IntegerQ[p
] || GtQ[a, 0])

Rubi steps

\begin{align*} \int \frac{\left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx &=\int \left (\frac{e^2}{c}+\frac{c d^2-a e^2+\left (2 c d e-b e^2\right ) x^n}{c \left (a+b x^n+c x^{2 n}\right )}\right ) \, dx\\ &=\frac{e^2 x}{c}+\frac{\int \frac{c d^2-a e^2+\left (2 c d e-b e^2\right ) x^n}{a+b x^n+c x^{2 n}} \, dx}{c}\\ &=\frac{e^2 x}{c}+\frac{\left (2 c d e-b e^2-\frac{2 c^2 d^2+b^2 e^2-2 c e (b d+a e)}{\sqrt{b^2-4 a c}}\right ) \int \frac{1}{\frac{b}{2}+\frac{1}{2} \sqrt{b^2-4 a c}+c x^n} \, dx}{2 c}+\frac{\left (2 c d e-b e^2+\frac{2 c^2 d^2+b^2 e^2-2 c e (b d+a e)}{\sqrt{b^2-4 a c}}\right ) \int \frac{1}{\frac{b}{2}-\frac{1}{2} \sqrt{b^2-4 a c}+c x^n} \, dx}{2 c}\\ &=\frac{e^2 x}{c}+\frac{\left (2 c d e-b e^2+\frac{2 c^2 d^2+b^2 e^2-2 c e (b d+a e)}{\sqrt{b^2-4 a c}}\right ) x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{c \left (b-\sqrt{b^2-4 a c}\right )}+\frac{\left (2 c d e-b e^2-\frac{2 c^2 d^2+b^2 e^2-2 c e (b d+a e)}{\sqrt{b^2-4 a c}}\right ) x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{c \left (b+\sqrt{b^2-4 a c}\right )}\\ \end{align*}

Mathematica [A]  time = 0.531575, size = 216, normalized size = 0.96 \[ \frac{x \left (\frac{\left (\frac{-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2}{\sqrt{b^2-4 a c}}-b e^2+2 c d e\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};\frac{2 c x^n}{\sqrt{b^2-4 a c}-b}\right )}{b-\sqrt{b^2-4 a c}}+\frac{\left (-\frac{-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2}{\sqrt{b^2-4 a c}}-b e^2+2 c d e\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{\sqrt{b^2-4 a c}+b}+e^2\right )}{c} \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x^n)^2/(a + b*x^n + c*x^(2*n)),x]

[Out]

(x*(e^2 + ((2*c*d*e - b*e^2 + (2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))/Sqrt[b^2 - 4*a*c])*Hypergeometric2F1[1
, n^(-1), 1 + n^(-1), (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])])/(b - Sqrt[b^2 - 4*a*c]) + ((2*c*d*e - b*e^2 - (2*c^
2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))/Sqrt[b^2 - 4*a*c])*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b
 + Sqrt[b^2 - 4*a*c])])/(b + Sqrt[b^2 - 4*a*c])))/c

________________________________________________________________________________________

Maple [F]  time = 0.036, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( d+e{x}^{n} \right ) ^{2}}{a+b{x}^{n}+c{x}^{2\,n}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x)

[Out]

int((d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{e^{2} x}{c} - \int -\frac{c d^{2} - a e^{2} +{\left (2 \, c d e - b e^{2}\right )} x^{n}}{c^{2} x^{2 \, n} + b c x^{n} + a c}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x, algorithm="maxima")

[Out]

e^2*x/c - integrate(-(c*d^2 - a*e^2 + (2*c*d*e - b*e^2)*x^n)/(c^2*x^(2*n) + b*c*x^n + a*c), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{e^{2} x^{2 \, n} + 2 \, d e x^{n} + d^{2}}{c x^{2 \, n} + b x^{n} + a}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x, algorithm="fricas")

[Out]

integral((e^2*x^(2*n) + 2*d*e*x^n + d^2)/(c*x^(2*n) + b*x^n + a), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d + e x^{n}\right )^{2}}{a + b x^{n} + c x^{2 n}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**n)**2/(a+b*x**n+c*x**(2*n)),x)

[Out]

Integral((d + e*x**n)**2/(a + b*x**n + c*x**(2*n)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (e x^{n} + d\right )}^{2}}{c x^{2 \, n} + b x^{n} + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x, algorithm="giac")

[Out]

integrate((e*x^n + d)^2/(c*x^(2*n) + b*x^n + a), x)